package com.itheima.dao;

import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserDao {



    @Select("select * from tb_user")
    public List<User> selectAll();


    @Select("select * from tb_user where id=#{id}")
    public User selectById(int id);

    @Insert("insert into tb_user values (null,#{username},#{password})")
    public int add(User user);

    @Update("update  tb_user set username=#{username},password=#{password} where id=#{id}")
    public int update(User user);

    @Delete("delete from tb_user where id=#{id}")
    public int deleteById(int id);
}
